package com.edu.jvm.unit01.Dynamic;

/**
 * @author five-five
 * 测试多态特性，理解动态绑定与静态绑定，早期绑定与晚期绑定
 */
public class AnimalDo {
    public static void staticDo(){
        System.out.println("AnimalDo 静态方法调用。。。。。");
    }
    public AnimalDo(Animal animal) {
        //早期绑定
        AnimalDo.staticDo();
        Biology animal1 = (Biology) animal;
        //晚期绑定
        animal1.breath();
        animal.eat();
        animal.run();
        animal.kill();
    }

    private void animalRun(Animal animal) {
        animal.run();
    }

    private void animalEat(Animal animal) {
        animal.eat();
    }

    private void animalKill(Animal animal) {
        animal.kill();
    }
}
